home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Libraries / CW GUSI 1.6.4 / Examples / GUSIFinger.c < prev    next >
C/C++ Source or Header  |  1994-12-31  |  1KB  |  49 lines

  1. /*********************************************************************
  2. Project    :    GUSI                -    Grand Unified Socket Interface
  3. File        :    GUSIFinger.c    -    finger daemon
  4. Author    :    Matthias Neeracher
  5. Language    :    MPW C
  6.  
  7. $Log: GUSIFinger.c,v $
  8. Revision 1.1  1994/02/25  02:47:06  neeri
  9. Initial revision
  10.  
  11. *********************************************************************/
  12.  
  13. #include <stdio.h>
  14. #include <Resources.h>
  15. #include <Processes.h>
  16. #include <Memory.h>
  17. #include <QuickDraw.h>
  18. #include <Fonts.h>
  19. #include <Windows.h>
  20.  
  21. void main()
  22. {
  23.     Handle    macName;
  24.     Handle    whoName;
  25.     
  26.     long    secs;
  27.     long    mins;
  28.     long    hour;
  29.     
  30.     InitGraf(&qd.thePort);
  31.     
  32.     macName = GetResource('STR ', -16413);
  33.     HLock(macName);
  34.     whoName = GetResource('STR ', -16096);
  35.     HLock(whoName);
  36.  
  37.     secs = TickCount() / 60;
  38.     mins = secs / 60;
  39.     hour = mins / 60;
  40.     
  41.     secs = secs - mins * 60;
  42.     mins = mins - hour * 60;
  43.     
  44.     printf("Macintosh belongs to:\t%P\r", *whoName);
  45.     printf("Macintosh is named:\t%P\r", *macName);
  46.     printf("Has been up for:\t%02d:%02d:%02d\r", hour, mins, secs);
  47. }
  48.  
  49.